﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using DAL;

namespace BLL
{
    public class BLLSanPham
    {
        private string idsp;
        public string Idsp
        {
            get { return idsp; }
            set { idsp=value; }
        }

        private string idloai;
        public string Idloai
        {
            get { return idloai; }
            set { idloai = value; }
        }
        private string tenloai;
        public string Tenloai
        {
            get { return tenloai; }
            set { tenloai = value; }
        }

        private string tensp;
        public string Tensp
        {
            get { return tensp; }
            set { tensp = value; }
        }

        private string kieudang;
        public string Kieudang
        {
            get { return kieudang; }
            set { kieudang = value; }
        }

        private string chatlieu;
        public string Chatlieu
        {
            get { return chatlieu; }
            set { chatlieu = value; }
        }

        private string kichco;
        public string Kichco
        {
            get { return kichco; }
            set { kichco = value; }
        }

        private string mau;
        public string Mau
        {
            get { return mau; }
            set { mau = value; }
        }

        private string xuatxu;
        public string Xuatxu
        {
            get { return xuatxu; }
            set { xuatxu = value; }
        }

        private string dongia;
        public string Dongia
        {
            get { return dongia; }
            set { dongia = value; }
        }

        private string hinh;
        public string Hinh 
        { 
            get { return hinh; } 
            set { hinh = value; } 
        }
        private BLLLoaiSanPham loaisanpham;
        public BLLLoaiSanPham LoaiSanPham
        {
            get { return loaisanpham; }
            set { loaisanpham = value; }
        }
        public BLLSanPham()
        { }
        public BLLSanPham(String _idsp, String _idloai,string _tenloai, String _ten, String _kieudang, String _chatlieu, String _kickco, String _mau, String _xuatxu, string _dongia, string _hinh)
        {
            Idsp = _idsp;
            Idloai = _idloai;
            Tenloai = _tenloai;
            Tensp = _ten;
            Kieudang = _kieudang;
            Chatlieu = _chatlieu;
            Kichco = _kickco;
            Mau = _mau;
            Xuatxu = _xuatxu;
            Dongia = _dongia;
            Hinh = _hinh;
        }
        public BLLSanPham(String _idsp, String _idloai,String _ten, String _kieudang, String _chatlieu, String _kickco, String _mau, String _xuatxu, string _dongia, string _hinh)
        {
            Idsp = _idsp;
            Idloai = _idloai;
            Tensp = _ten;
            Kieudang = _kieudang;
            Chatlieu = _chatlieu;
            Kichco = _kickco;
            Mau = _mau;
            Xuatxu = _xuatxu;
            Dongia = _dongia;
            Hinh = _hinh;
        }
        public BLLSanPham(string _idloai)
        {
           Idloai = _idloai;
        }
        public BLLSanPham(string _idsp,string _ten)
        {
            idsp = _idsp;
            Tensp = _ten;
        }
        //lay  san pham moi'
        public static List<BLLSanPham> Get6()
        {
            return DALSanPham.Get6();
        }
        public static List<BLLSanPham> GetAll()
        {
            return DALSanPham.GetAll();
        }

        //hien thi san pham theo danh muc
        private List<BLLSanPham> Getspdm;
        public List<BLLSanPham> GetSpdm
        {
            get
            {
                if (Getspdm == null)
                {
                    Getspdm = DALSanPham.GetSPDM(this);
                }
                return Getspdm; 
            }
            set 
            {
                Getspdm = value; 
            }
    
    }
        //hien thi san pham tim kiem 
              private List<BLLSanPham> Getsptk;
              public List<BLLSanPham> GetSptk
              {
                  get
                  {
                      if (Getsptk == null)
                      {
                          Getsptk = DALSanPham.GetSPTK(this);
                      }
                      return Getsptk;
                  }
                  set
                  {
                      Getsptk = value;
                  }
              }


        //hien thi chi tiet san pham
              private List<BLLSanPham> Showchitiet;
              public List<BLLSanPham> ShowChitiet
              {
                  get
                  {
                      if (Showchitiet == null)
                      {
                          Showchitiet = DALSanPham.ShowChiTiet(this);
                      }
                      return Showchitiet;
                  }
                  set
                  {
                      Showchitiet = value;
                  }
              }
        //them san pham
              public string AddSanPham()
              {
                  return DALSanPham.AddSanPham(this);
              }
        //sua san pham
              public string Edit()
              {
                  return DALSanPham.Edit(this);
              }
        //Xóa sản phẩm
              public void Delete()
              {
                  DALSanPham.Delete(this);
              }
        //lay sp theo id
              public List<BLLSanPham> GetbyId()
              {
                  return DALSanPham.GetbyId(this);
              }
    }
}
